package com.qcby.controller;

import com.qcby.entity.Result;
import com.qcby.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/question")
public class QuestionController {
    @Autowired
    private QuestionService questionService;
    @RequestMapping("/list")
    public Result list() {
        return Result.success(questionService.list());
    }
    @PostMapping("getByExamId")
    public Result getByExamId(Integer id) {
        return Result.success(questionService.getByExamId(id));
    }
    @PostMapping("getQuestionTypeAndCount")
    public Result getQuestionTypeAndCount(Integer id) {
        return Result.success(questionService.getQuestionTypeAndCount(id));
    }
}
